package juan.happyge.plugin.myi.view.action;

import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.application.Application;
import com.intellij.openapi.ui.popup.JBPopup;
import com.intellij.openapi.ui.popup.JBPopupFactory;
import com.intellij.ui.components.JBLabel;
import org.jetbrains.annotations.NotNull;

import javax.swing.*;

import java.awt.*;


/**
 * 弹出章节面板动作
 */
public class PopupChapterAction extends AnAction {

    @Override
    public void actionPerformed(@NotNull AnActionEvent anActionEvent) {
        JButton button = new JButton("Hello Idea Plugin");//新建Button放到自定义弹框中
        JPanel panel = new JPanel();
        panel.setSize(40,20);//限制Buton大小，否则会填充整个弹框
        panel.add(button);
        button.addActionListener(d -> System.out.println("Hello Idea Plugin"));// 添加监听事件


    }


}
